#ifndef _MMAP_H
#define _MMAP_H

#include <process.h>
#include <fs.h>
#include <type.h>

#define PROT_NONE	0x0
#define PROT_READ	0x1
#define PROT_WRITE	0x2
#define PROT_EXEC   0x4

#define MMAP_SHARED	    0x01
#define MMAP_PRIVATE	0x02
#define MMAP_ANONYMOUS	0x04
#define MMAP_FIXED	    0x08
#define MMAP_REPLACE    0x10

struct mmap_args {
    struct mm* mm;
    size_t len;
    u32 prot;
    u32 flags;
    size_t file_offset;
};

int do_memmap(uptr* addr_out, uptr vaddr, file_t* file, struct mmap_args* args);

#endif /* _MMAP_H */